import request from '@/utils/request'


export function register(data) {
  return request({
    url: '/vendor/register',
    method: 'post',
    data
  })
}

export function list(query) {
  return request({
    url: '/vendor/list',
    method: 'get',
    params: query
  })
}

export function del(data) {
  return request({
    url: '/vendor/delete',
    method: 'post',
    data
  })
}

export function publish(data) {
  return request({
    url: '/vendor/create',
    method: 'post',
    data
  })
}

export function detail(id) {
  return request({
    url: '/vendor/read',
    method: 'get',
    params: { id }
  })
}
export function myVendor() {
  return request({
    url: '/vendor/myVendor',
    method: 'get'
  })
}

export function editMyVendor(data) {
  return request({
    url: '/vendor/editMyVendor',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: '/vendor/update',
    method: 'post',
    data
  })
}

export function approve(data) {
  return request({
    url: '/vendor/approve',
    method: 'post',
    data
  })
}

export function getEmployees(id) {
  return request({
    url: '/vendor/employees',
    method: 'get',
    params: { vendorId:id }
  });
}

export function publishEmployee(data) {
  return request({
    url: '/vendor/publishEmployee',
    method: 'post',
    data
  });
}
export function deleteEmployee(data) {
  return request({
    url: '/vendor/deleteEmployee',
    method: 'post',
    data
  });
}
export function editEmployee(data) {
  return request({
    url: '/vendor/editEmployee',
    method: 'post',
    data
  });
}


export function getAddr() {
  return request({
    url: '/vendor/getAddr',
    method: 'get',
  })
}

export function regCaptcha(mobile) {
  return request({
    url: '/vendor/regCaptcha',
    method: 'post',
    data:{mobile}
  })
}